package com.angel.service.ServiceImpl;

import com.angel.bean.Webresource;
import com.angel.mapper.WebresourceDao;
import com.angel.service.WebresourceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

@Service
public class WebresourceServiceImpl implements WebresourceService {

    @Resource
    private WebresourceDao webresourceDao;

    @Override
    public int insert(Webresource webresource){
        return webresourceDao.insert(webresource);
    }

    @Override
    public int insertSelective(Webresource webresource){
        return webresourceDao.insertSelective(webresource);
    }

    @Override
    public int insertList(List<Webresource> webresources){
        return webresourceDao.insertList(webresources);
    }

    @Override
    public int update(Webresource webresource){
        return webresourceDao.update(webresource);
    }

    @Override
    public List<Webresource> findWebresource(Webresource webresource) {
        return webresourceDao.findWebresource(webresource);
    }

    @Override
    public Webresource findOne(Webresource webresource) {
        List<Webresource> list =this.findWebresource(webresource);
        if (list==null || list.isEmpty()){
            return null;
        }
        return list.get(0);
    }

    @Override
    public int delete(Webresource webresource) {
        return webresourceDao.delete(webresource);
    }

    @Override
    public List<Webresource> searchWebresource(Webresource webresource) {
        return webresourceDao.searchWebresource(webresource);
    }
}
